﻿namespace csharphomework
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.Write("请输入月数：");
            int month = int.Parse(Console.ReadLine());

            int result = GetRabbitCount(month);
            Console.WriteLine("第" + month + "个月有" + result + "对兔子");
        }

        static int GetRabbitCount(int n)
        {
            if (n == 1 || n == 2)
                return 1;
            int a = 1;
            int b = 1;
            int c = 0;

            for (int i = 3; i <= n; i++)
            {
                c = a + b;
                a = b;
                b = c;
            }

            return c;
        }
    }
    
}
